package adv9;

import java.net.*;
import java.io.*;

public class MyClient {
	public static void main(String[] args) {
		Socket s = null;
		try {
			s = new Socket("localhost", 6666);
			InputStream in = s.getInputStream();
			OutputStream out = s.getOutputStream();
			PrintWriter pw = new PrintWriter(out, true);// 自动刷新
			BufferedReader br = new BufferedReader(new InputStreamReader(in));
			// pw.flush();
			pw.println("今天中午吃什么，小孙给大伙加鸡腿！");
			// pw.flush();

			String repy = br.readLine();
			System.out.println(repy);

		} catch (IOException e) {
			// TODO 自动生成的 catch 块
			e.printStackTrace();
		} finally {
			if (s != null)
				try {

					s.close();
				} catch (IOException e) {
					// TODO 自动生成的 catch 块
					e.printStackTrace();
				}
		}

	}
}
